<div id="item_pager" class="jqpager" style="margin-top:5px;overflow:hidden;display:inline;float:right"></div>		
<div style="display: inline-table; width: auto; margin-bottom:5px">
   #if(shop??)
  <span>店铺名称：#(shop.shop_name??)</span>
  <input type="hidden" id="youzan-shop" value="#(shop.id??)" />
  #end
</div>
<div style="display: inline-table; width: auto; margin-bottom:5px;position: relative;top: -2px;">
  <input style="margin:0 10px" type="text" id="product_txt" placeholder="商品名称" class="control-inline" />
  <button id="queryBtn" class="btn btn-success btn-sm">查询</button>
</div>
<table class="table table-striped table-bordered" id="mainProductTable" style="padding-top: 5px;" border="0">
	<thead>
		<tr>
			<th><span style="vertical-align: middle;">&nbsp;&nbsp;商品</span></th>
			<th>商品地址</th>
			<th>创建时间</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody class="productLotGrid"></tbody>
</table>
<!-- html 模板文件 -->
<script type="text/template" id="product_table_tr_tpl_url">
{{each list as item i}}
	<tr id="tr_id_{{item.itemId}}" class="package" data-id="{{item.itemId}}" data-price="{{item.price}}" data-title="{{item.title}}" data-digest="{{item.shareTitle}}" data-image="{{item.image}}" data-url="{{item.url}}">
	<td><img width="40" height="40" src="{{item.image}}"><a class="new-window" href="javascript:void(0)" title="{{item.title}}">&nbsp;{{item.simpleTitle}}</a></img></td>
	<td><a href="{{item.url}}" target="_blank">访问商品</a></td>            
    <td><span>{{item.createdTime}}</span></td>
	<td><a onclick="chooseItem(this)"  class="btn btn-success">选择</a></td>
</tr>
{{/each}}
</script>
<script type="text/template" id="table_noresult_tr_tpl_url">
	<tr class="package"><td class="center" colspan="4">没有数据</td></tr>
</script>
<script type="text/template" id="option_tpl_url">
	<option value="{{id}}">{{shopName}}</option>
</script>
<script type="text/javascript">
$(document).ready(function() {
	var params = {};
	params.shopId = $("#youzan-shop").val();
	var table = new obz.TableView("item_pager", "#(webctx)/product/youzan/list", params, function(resp){
		if(resp && resp.list && resp.list.length>0){
			$('.productLotGrid').html(template('product_table_tr_tpl_url', resp));
			TBatch.tableId = "mainProductTable";
			//初始化checkbox点击事件
			TBatch.checkCheckbox();
			TBatch.initCheckboxClick();
		}
	}); 
	table.init();
	
	$("#queryBtn").bind("click",function(){
		var params = {};
		params.productTxt = $("#product_txt").val();
		params.shopId = $("#youzan-shop").val();
		table.setParams(params);
		table.init();
	}); 
});
</script>